﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace POC.Azure.Bag
{
    public   class DictionaryStore<T> : IStore<T>
    {
        Dictionary<string, T> holders = new Dictionary<string, T>();
        public DictionaryStore()
        {
        }
        public T Get(string key)
        {
           return holders[key];
        }

        public void Put(string key, T item)
        {
            holders[key] = item;
        }

        public void Remove(string key)
        {
            holders.Remove(key);
        }

        public IEnumerable<KeyValuePair<string,T>> List()
        {
           var list = (from kp in holders select kp);
           return list.ToList();
        }
    }
}
